clc
Nr=10;
Ne=2;
M=10;
K=2;
e=0.5;
R=0.1;
hr=randn(1,Nr)+1i*randn(1,Nr);
G=randn(Nr,M)+1i*randn(Nr,M);
Dr=randn(Ne,Nr,K)+1i*randn(Ne,Nr,K);
F=eye(Nr);
[ W ] = SolveW( hr,G,F,Dr,e,R,M,Nr,Ne,K )
trace(W)-norm(W,2)